﻿/**
* 
* @author Chen
* @version 1.0
* add reference https://apis.google.com/js/client:platform.js to your web site
*/
if(!window.top.ngUNVS){
    window.top.ngUNVS={};
}
window.top.ngUNVS.google=angular.module("ng-unvs-google",[]);
window.top.ngUNVS.google.service("$api",function(){
    window.top.ngUNVS.google.$apiInstance={
        $params:{
            clientid:undefined,
            cookiepolicy:'single_host_origin'
        }
        
    };
    return{
        $setClientID:function(){
            window.top.ngUNVS.google.$apiInstance.$params.clientid=value;
        },
        $getClientID:function(){
            return window.top.ngUNVS.google.$apiInstance.$params.clientid;
        },
        $login:function(callback){
            gapi.auth.signIn({
                clientid:window.top.ngUNVS.google.$apiInstance.$params.clientid,
                cookiepolicy:window.top.ngUNVS.google.$apiInstance.$params.cookiepolicy,
                callback:callback
            });
        }
    }
});
